<?php
/* @var $this ProductController */
/* @var $model Product */


Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#product-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h3><?php echo Yii::t('product', 'product_manage') ?></h3>
<a href="<?php echo $this->createUrl('/manage/product/create/');?>" class="btn"><?php echo Yii::t('category','商品添加');?></a>

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'product-grid',
	'cssFile'=>false,
	'emptyText'=>'未找到符合条件数据',
	'itemsCssClass'=>'table table-bordered table-hover',
	'dataProvider'=>$model->search(),
	'summaryText'=>"",
	'columns'=>array(
		'id',
		'name',
		array(
			'name'=>'price',
			'value'=>'$data->currencyUnit.$data->price'
		),
		'category.name',
		'createtime',
		'user.username',
		array(
		'class'=>'application.views.widgets.zii-grid.BButtonColumn',
		)
	),
)); ?>
